package cn.wolfcode.crm.service.impl;

import cn.wolfcode.crm.domain.SystemDictionary;
import cn.wolfcode.crm.mapper.SystemDictionaryMapper;
import cn.wolfcode.crm.qo.QueryObject;
import cn.wolfcode.crm.service.SystemDictionaryService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SystemDictionaryServiceImpl implements SystemDictionaryService {
    @Autowired
    private SystemDictionaryMapper systemDictionaryMapper;

    @Override
    public void insert(SystemDictionary systemDictionary) {
        systemDictionaryMapper.insert(systemDictionary);
    }

    @Override
    public void deleteByPrimaryKey(Long id) {
        systemDictionaryMapper.deleteByPrimaryKey(id);
    }

    @Override
    public SystemDictionary selectByPrimaryKey(Long id) {

        return systemDictionaryMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<SystemDictionary> selectAll() {
        return systemDictionaryMapper.selectAll();
    }


    @Override
    public void updateByPrimaryKey(SystemDictionary systemDictionary) {
        systemDictionaryMapper.updateByPrimaryKey(systemDictionary);
    }

    @Override
    public PageInfo<SystemDictionary> query(QueryObject qo) {

        PageHelper.startPage(qo.getCurrentPage(),qo.getPagSize());

        return new PageInfo<>(systemDictionaryMapper.queryForList(qo));
    }

   /* @Override
    public List<SystemDictionary> queryBysystemDictionarysn() {
        return systemDictionaryMapper.queryBysystemDictionarysn();
    }*/

}
